package com.hospital.hospitalserver.controller;

import com.hospital.hospitalserver.entity.ManagerDetailDTO;
import com.hospital.hospitalserver.entity.query.AdminStaffQuery;
import com.hospital.hospitalserver.service.ManagerService;
import com.hospital.hospitalserver.util.Response;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.*;

/**
 * 行政管理人员相关数据接口
 * */
@RestController
@CrossOrigin
@RequiredArgsConstructor
@RequestMapping("/adminStaff")
public class ManagerController {
    private final ManagerService managerService;

    /**
     * 新增行政人员
     * */
    @PostMapping("/addManager")
    public Response addManager(@RequestBody ManagerDetailDTO request){
        return managerService.addManager(request);
    }

    /**
     * 编辑行政人员
     * */
    @PostMapping("/editManager")
    public Response editManager(@RequestBody ManagerDetailDTO request){
        return managerService.editManager(request);
    }

    /**
     * 删除行政人员
     * */
    @PostMapping("/deleteManager")
    public Response deleteManager(@RequestBody ManagerDetailDTO request){
        return managerService.deleteManager(request);
    }

    /**
     * 加载行政人员职称列表数据
     * */
    @GetMapping("/getAdminStaffProfessionalList")
    public Response getAdminStaffProfessionalList(){
        return managerService.getAdminStaffProfessionalList();
    }

    /**
     * 加载行政管理人员分页数据
     * */
    @PostMapping("/getAdminStaffPagerDataBySearch")
    public Response getAdminStaffPagerDataBySearch(@RequestBody AdminStaffQuery query){
        return managerService.getAdminStaffPagerDataBySearch(query);
    }
}
